<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>事件绑定</title>
    <!--②使用dom分配-->
</head>
<body>
<!--事件源-->
<button id="btn">点我呀</button>

</body>
<script>
    var buttonEle = document.getElementById("btn");
    buttonEle.onclick = function () {
        console.log("helloworld");

    }
</script>

</html>